<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>My App</title>
    <link rel="stylesheet" href="../../packages/core/css/framework7.min.css">
    <link rel="stylesheet" href="../../css/framework7-icons.css">
  </head>
  <body>
    <div id="app"></div>
    <template id="app-template">
      <f7-app>
        <f7-view main>
          <f7-page>
            <f7-navbar title="Smart Select"></f7-navbar>
            <f7-list v-if="showPageSS">
              <f7-list-item title="Fruit" smart-select>
                <select name="fruits">
                  <option value="apple" selected>Apple</option>
                  <option value="pineapple">Pineapple</option>
                  <option value="pear">Pear</option>
                  <option value="orange">Orange</option>
                  <option value="melon">Melon</option>
                  <option value="peach">Peach</option>
                  <option value="banana">Banana</option>
                </select>
              </f7-list-item>
              <f7-list-item title="Car" smart-select :smart-select-params="{openIn: 'popup', searchbar: true, searchbarPlaceholder: 'Search car', routableModals: false}">
                <select name="car" multiple>
                  <optgroup label="Japanese">
                    <option value="honda" selected>Honda</option>
                    <option value="lexus">Lexus</option>
                    <option value="mazda">Mazda</option>
                    <option value="nissan">Nissan</option>
                    <option value="toyota">Toyota</option>
                  </optgroup>
                  <optgroup label="German">
                    <option value="audi" selected>Audi</option>
                    <option value="bmw">BMW</option>
                    <option value="mercedes">Mercedes</option>
                    <option value="vw">Volkswagen</option>
                    <option value="volvo">Volvo</option>
                  </optgroup>
                  <optgroup label="American">
                    <option value="cadillac">Cadillac</option>
                    <option value="chrysler">Chrysler</option>
                    <option value="dodge">Dodge</option>
                    <option value="ford" selected>Ford</option>
                  </optgroup>
                </select>
              </f7-list-item>
              <f7-list-item title="Mac or Windows" smart-select :smart-select-params="{openIn: 'sheet', routableModals: false}">
                <select name="mac-windows">
                  <option value="mac" selected>Mac</option>
                  <option value="windows">Windows</option>
                </select>
              </f7-list-item>
              <f7-list-item title="Super Hero" smart-select :smart-select-params="{openIn: 'popover', routableModals: false}">
                <select name="superhero" multiple>
                  <option value="Batman" selected>Batman</option>
                  <option value="Superman">Superman</option>
                  <option value="Hulk">Hulk</option>
                  <option value="Spiderman">Spiderman</option>
                  <option value="Ironman">Ironman</option>
                  <option value="Thor">Thor</option>
                  <option value="Wonder Woman">Wonder Woman</option>
                </select>
              </f7-list-item>
            </f7-list>
          </f7-page>
        </f7-view>
      </f7-app>
      
    </template>
    <script>
      var component = {
        data() {
          return {
            showPageSS: false,
          };
        },
        mounted() {
          const self = this;
          setTimeout(()=>{
            self.showPageSS = true;
          },0);
        },
      }
    </script>
    <script src="../../packages/vue/vue.min.js"></script>
    <script src="../../packages/vue/framework7-vue.min.js"></script>
    <script src="../../packages/core/js/framework7.min.js"></script>
    <script>
      var theme = 'ios';
      if (location.href.indexOf('theme=md') >= 0) theme = 'md';
      
      if (Framework7.use) Framework7.use(Framework7Vue, { theme: theme });
      else if (Framework7.Class && Framework7.Class.use) Framework7.Class.use(Framework7Vue, { theme: theme });
      
      var plugin = {
        params: {
          theme: theme,
        }
      };
      
      if (Framework7.use) Framework7.use(plugin);
      else if (Framework7.Class && Framework7.Class.use) Framework7.Class.use(plugin);
      
      if (typeof component === 'undefined') {
        var component = {};
      }
      if (typeof routes === 'undefined') {
        var routes = [];
      }
      component.el = '#app';
      component.template = '#app-template';
      
      new Vue(component);
    </script>
  </body>
</html>